import { extensions } from '@/config/index'
import extensionLoader from '@/plugins/extension-loader/index'
import iView from 'iview'
export default () => {
  for (let name in extensions) {
    if (extensions[name].autoLoad) {
      extensionLoader(name)
        .then(() => {
          console.log('模块' + name + '已自动加载。')
        })
        .catch(error => {
          iView.Modal.error({
            title: `错误${error.code}`,
            content: error.message
          })
        })
    }
  }
}
